/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gfs.board;

import gfs.location.Location;
import java.util.ArrayList;

/**
 * <tt>Board</tt> is an interface for a two-dimensional grid like enviornment
 * that will contain objects.
 * 
 * @author Joel
 */
public interface Board
    {  
    
    /**
     * This method should return an object array filled with all the different
     * objects to be placed onto this board
     * 
     * @return
     *      An Obejct array of all the obejcts on this board
     */
    public Object[][] getMap();
    
    /**
     * Sets an object to the board 
     * 
     * @param obj
     *      The object to be added to the board
     * @param loc
     *      The location to set the object to
     * @return
     *      True if the object was added
     */
    public boolean set(Object obj, Location loc);
    
    /**
     * Returns the object at the specified location
     * 
     * @param loc
     *      The location to get a obj from     
     * @return
     *      The object at the specified row and column of this board
     */
    public Object get(Location loc);
    
    /**
     * Will remove the object at the given location
     * 
     * @param loc
     *      The location to remove the object from
     * @return 
     *      The object that was removed or null if it was empty
     */
    public Object remove(Location loc);
    
    /**
     * Checks if the specified location is valid for the board
     * 
     * @param loc
     *      The location to check if it is valid
     * @return
     *      <tt>true</tt> if the location is valid, otherwise <tt>false</tt>
     */
    public boolean isValid(Location loc);
    
    /**
     * Returns the locations that are adjacent to the specified location and are 
     * valid
     * 
     * @param loc
     *      The location from which to get its adjacent locations
     * @return
     *      An ArrayList of all valid adjacent locations to the specified one
     */
    public ArrayList<Location> getAdjacentLocations(Location loc);
        
    /**
     * Moves the piece at the designated location
     * 
     * @param loc
     *      The location on the board which the piece is at
     * @return
     *      An <code>ArrayList</code> containning all the possible movement 
     * locations for the designated obj. Null if there is none
     */
    public boolean movePiece(Location loc);
    }   
